﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace jSLCore.Client.Presentation.BaseControl.Advanced
{
    /// <summary>
    /// Shows the Image as Dialog
    /// </summary>
    public partial class ShowImageDialog : DialogControl
    {
        private ImageSource _imageSource;

        /// <summary>
        /// Only for designers, dont use it
        /// </summary>
        public ShowImageDialog()
        {
            InitializeComponent();
        }

        public static void ShowDialog(ImageSource imageSource, BaseControl parent)
        {
            var dlg = new ShowImageDialog(imageSource);
            dlg.ShowDialog(parent);
        }

        private ShowImageDialog(ImageSource imageSource)
        {
            InitializeComponent();
            _imageSource = imageSource;
        }

        public override bool IsOkVisible
        {
            get { return false; }
        }

        public override bool IsStandartOkCancelEnabled
        {
            get { return true; }
        }

        public override object CancelContent
        {
            get { return "Закрыть"; }
        }

        public override void LoadInitialData()
        {
            img.Source = _imageSource;
        }
    }
}
